package com.zz.common.service

import java.util.UUID

import com.zz.common.adapter.EventAdapter
import com.zz.common.exception.TransactionException
import com.zz.idl.IdBundle
import com.zz.dsp.idl.DspEvent

/**
  * @author huanggh
  *         19-8-21 下午3:47
  */
object EventAdapterService {
  def apply(): EventAdapterService = new EventAdapterService()
}

class EventAdapterService extends EventAdapter[DspEvent, IdBundle] {
  def transfor(in: DspEvent): IdBundle = IdBundle(
    zid = ""
    , imei = in.imei
    , imeiMd5 = in.imeiMd5
    , imeiSha1 = in.imeiSha1
    , imsi = in.imsi
    , imsiMd5 = in.imsiMd5
    , imsiSha1 = in.imsiSha1
    , androidId = in.androidId
    , androidIdMd5 = in.androidIdMd5
    , androidIdSha1 = in.androidIdSha1
    , mac = in.mac
    , macMd5 = in.macMd5
    , macSha1 = in.macSha1
    , sn = in.sn
    , idfa = in.idfa
    , idfv = in.idfv
    , mid = in.mid
  )


  override def contraMap(out: IdBundle): Either[TransactionException, DspEvent] = super.contraMap(out)
}
